package com.zhengping.zpys.security.product;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author chenweizuan
 * @description This is description of class
 * @version 1.0
 * @date 2020/3/31 19:28
 */
@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    ProductMapper productMapper;

    @Override
    public Integer createProduct(Product product) {
        return productMapper.createProduct(product);
    }

    @Override
    public Integer updateProduct(Product product) {
        return productMapper.updateProduct(product);
    }

    @Override
    public List<Product> queryProductListByCategoryId(Long categoryId) {
        return productMapper.queryProductListByCategoryId(categoryId);
    }

    @Override
    public List<Product> queryProductListByName(String productName) {
        return productMapper.queryProductListByName(productName);
    }

    @Override
    public Product queryProductListByProductId(Long productId) {
        return productMapper.queryProductListByProductId(productId);
    }

    @Override
    public Integer deleteProductList(Long[] productIds) {
        return productMapper.deleteProductList(productIds);
    }
}
